//
//  FontAttributeConfig.m
//  MyFunctionDemo
//
//  Created by Ting Han on 2017/9/1.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "FontAttributeConfig.h"

@implementation FontAttributeConfig

- (NSString *)attributeName{
    return NSFontAttributeName;
}
- (id)attributeValue{
    if (self.font) {
        return self.font;
    }else{
        return [UIFont systemFontOfSize:[UIFont systemFontSize]];
    }
}
+ (instancetype)configWithFont:(UIFont *)font{
    FontAttributeConfig *config = [[[self class] alloc]init];
    config.font = font;
    return config;
}
+ (instancetype)configWithFont:(UIFont *)font range:(NSRange)range{
    FontAttributeConfig *config = [[[self class] alloc]init];
    config.font = font;
    config.effectiveStringRange = range;
    return config;
}


@end
